exports.install = function (Vue, options) {


  //跳转页面
  Vue.prototype.goHref = function (name,data) {
    this.$router.push({name: name,params: {data }})
  };
  //跳转页面传值给store
  Vue.prototype.goHrefS = function (name,key,data) {
    console.log('goHrefS',name,key,data)
    this.$store.state.login[key]= data
    this.$router.push({name: name})
  };
  //时间戳转字符型日期
  Vue.prototype.toDate = function (date) {
    if (!date) {
      return "无"
    }
    Date.prototype.toLocaleString = function () {
      return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate() + " " + this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds();
    };
    var unixTimestamp = new Date(date * 1000)
    return unixTimestamp.toLocaleString();
  };
  //时间戳转字符型日期
  Vue.prototype.formatDate = function (date) {
    if (!date) {
      return "无"
    }
    Date.prototype.toLocaleString = function () {
      return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate() + " " + this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds();
    };
    var unixTimestamp = new Date(date * 1000)
    return unixTimestamp.toLocaleString();
  };
  Vue.prototype.formatDate1 = function (date) {//全局函数2
    if (!date) {
      return "无"
    }
    Date.prototype.toLocaleString = function () {
      return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate();
    };
    var unixTimestamp = new Date(date.time)
    return unixTimestamp.toLocaleString();
  };
};
